import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);//vue的插件机制

//Vuex.Store 构造器选项
const store = new Vuex.Store({
    state:{
        codeWaitTime:60
    },
	mutations: {
		reduce(state) {
			let timer=setInterval(()=>{
				state.codeWaitTime -= 1
				if(state.codeWaitTime===0){
					clearInterval(timer)
					state.codeWaitTime=60
				}
			},1000)
		}
	}
})
export default store